@model TodoViewModel
@using Humanizer
@{
    ViewData["Title"] = "Manage your Todo List";
}

<div class="panel panel-default todo-panel">
    <div class="panel-header">Todo List</div>

    <table class="table table-hover">
        <thead>
            <tr>
                <td>&#x2714;</td>
                <td>Item</td>
                <td>DueTime</td>
            </tr>
        </thead>

        @foreach (var item in Model.Items)
        {
            <tr>
                <td>
                    <form asp-action="MarkDone" method="POST">
                        <input type="checkbox" class="done-check" checked="@item.IsDone">
                        <input type="hidden" name="id" value="@item.Id">
                    </form>
                </td>
                <td>@item.Title</td>
                <td>@item.DueAt.Humanize()</td>
            </tr>
        }
    </table>

    <div class="panel-footer add-item-form">
        <!--  Add item form -->
        @await Html.PartialAsync("AddItemPartial", new TodoItem(){
            Title = "input the title"
        });
    </div>
</div>